﻿@model IEnumerable<Citi.EmailSender.WebUi.Models.EmailModel>
<table class="table table-bordered table-striped">
    <tr>
        <th>
            Subject
        </th>
        <th>
            On Behalf Of
        </th>
        <th>
            Application
        </th>
        <th>
            Sent On
        </th>
        <th>
            Schedule Date
        </th>
        <th>
            Approved
        </th>
    </tr>
    @{
        if (Model != null && Model.Any())
        {
            foreach (var item in Model)
            {
        <tr>
            <td>@Html.DisplayFor(modelItem => item.EmailData.Subject)
            </td>
            <td>@Html.DisplayFor(modelItem => item.EmailData.OnBehalfOf.FriendlyName)
            </td>
            <td>@Html.DisplayFor(modelItem => item.EmailData.Application.FullName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.SentOn)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ScheduleDate)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Approved)
            </td>
        </tr>
            }
        }
        else
        {
            <tr>
                <td colspan="6">
                    No emails was found.
                </td>
            </tr>
        }
    }
</table>
